﻿using DataModels.Dto;
using Microsoft.AspNetCore.Mvc;
using Services.Base;

namespace PropertyManagementWebApi.Controllers.Base
{
    public class ProjectController(ProjectService projectService) : BaseController
    {
        protected readonly ProjectService _projectService = projectService;

        /// <summary>
        /// 获取项目列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetProject()
        {
            return _projectService.GetProject();
        }

        /// <summary>
        /// 获取全部项目列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetProjectList()
        {
            return _projectService.GetProjectList();
        }

        /// <summary>
        /// 获取楼栋信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetBuilding(string? ProjectUUID)
        {
            return _projectService.GetBuilding(ProjectUUID);
        }

        /// <summary>
        /// 获取楼栋的单元信息
        /// </summary>
        /// <param name="BuildUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetUnitByBuilding(string BuildUUID, string? ProjectUUID)
        {
            return _projectService.GetUnitByBuilding(BuildUUID, ProjectUUID);
        }

        /// <summary>
        /// 获取楼层信息
        /// </summary>
        /// <param name="UnitUUID"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetFloorByUnit(string UnitUUID, string? ProjectUUID)
        {
            return _projectService.GetFloorByUnit(UnitUUID, ProjectUUID);
        }

        /// <summary>
        /// 获取对应楼层的房号信息
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetRoomNoByFloor(string FloorUUID, string ProjectUUID)
        {
            return _projectService.GetRoomNoByFloor(FloorUUID, ProjectUUID);
        }

        /// <summary>
        /// 获取房号信息根据楼栋UUID
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetRoomNoByBuildUUID(string BuildUUID, string ProjectUUID)
        {
            return _projectService.GetRoomNoByBuildUUID(BuildUUID, ProjectUUID);
        }


        /// <summary>
        /// 获取房产列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetProperties(Guid ProjectId)
        {
            return _projectService.GetProperties(ProjectId);
        }
    }
}
